<?php

defined("_ARKN_EXEC") or exit("no no, mr. superman no here");
($_SESSION["roleid"] == Roles::Secretary) or exit("you almost got away with it");
require ROOT_FOLDER . "/php/pages/menu_strip.php";
require_once ROOT_FOLDER . "/php/scripts/account_scripts/Account.php";

$result = array();
$result = $account->studentList();

print("<br />");
print("<br />");

print('<div style="width:100%; text-align: center;">');
print('<div style="display: inline-block;">');

print('<table cellpadding="0" cellspacing="0" class="db-table">');

print("<tr>");
print("<th>Student ID</th>");
print("<th>Full Name</th>");
print("<th>User Name</th>");
print("<th>Address</th>");
print("<th>Email</th>");
print("</tr>");

foreach($result as $row) {
	print("<tr>");
	print("<td> <a href=?page=viewstudent&studentid=" . htmlEsc($row["accountid"]) . ">" . htmlEsc($row["accountid"]) . "</a> </td>");
	print("<td>" . htmlEsc($row["firstname"]) . " " . htmlEsc($row["lastname"]) . "</td>");
	print("<td>" . htmlEsc($row["username"]) . "</td>");
	print("<td>" . htmlEsc($row["address"]) . "</td>");
	print("<td>" . htmlEsc($row["email"]) . "</td>");
	print("</tr>");
}

print("</table>");

print("</div>");
print("</div>");
?>